package com.ir.ykzteencoder;

import com.ykan.ykds.ctrl.utils.Ciphertext;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.media.AudioTrack;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.Button;

public class MainActivity extends Activity {

	private static final String TAG = "MainActivity";
	Button button1;
	Button button2;
	MainActivity mAc;
	@SuppressLint("NewApi")
	
	private Ciphertext ciphertext;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		mAc = this;
		ciphertext = Ciphertext.getInstance(getApplicationContext());
		button1 = (Button) findViewById(R.id.button1);
		this.getApplicationContext().getPackageName();
		// button2 = (Button) findViewById(R.id.button2);
		button1.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
//				String encode="B8R[UUS2LEM8HGX4YL1C[8[L5]B2ED9QS6QN3]M0YT7[O4KT1CK8CJ5OO2ID9WU6KD3GS0IZ7]H4W\\1CU8EH5E[2MD9CW6ET3OW0SF7WC4IJ1CE8GF5UM2QD9IY6YJ3W[0CL7UW4UR1CO8ID5OW2UD9O[6SZ3EE0MR7SQ4GZ1CY8K\\5[K2YD9UC6MP3QH0WX7QK4SH1GG8MZ5QW2CD9[E6GF3YK0GD7OF4EP1HRE7WD4MG1CF8KC5UN2QC9IZ6YI3W\\0CK7UX4UQ1CP8IC5KZ2UC9O\\6SY3EF0MQ7SR4GY1CZ8K[5[L2YC9UD6QM3MJ0WW7QL4SG1CJ8MY5QX2CC9[F6GE3UN0GC7OF4EO1CT8OW5GJ2GC9GH6[U3CR0QI7MZ4QW1CD8QU5WV2KC9MJ6UK3KV0[O7KT4CE1CN8WR5MH";
				/*new Thread(){
				  public void	run(){
					  Log.e(TAG,"thread");
//					  wavir.getInstance().IRTest("");
					}
				}.start();*/
				String encode = ciphertext.e("1,38000,229,75,21,41,22,41,22,21,22,21,22,41,22,21,22,41,22,21,22,21,22,41,22,21,22,41,22,41,22,21,22,41,22,21,22,21,22,21,22,21,22,41,22,21,22,21,22,41,22,21,139,138,22,21,21,20,21,41,22,20,21,41,22,20,21,41,22,20,21,41,22,41,22,41,22,20,21,41,22,41,22,20,21,41,22,3000");
				Log.i(TAG, " ciphertext enCode:" + encode);
				Log.i(TAG, " ciphertext decode:" + ciphertext.d(encode));
			}
		});
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
